/* 
 * AP(r) Computer Science GridWorld Case Study:
 * Copyright(c) 2005-2006 Cay S. Horstmann (http://horstmann.com)
 *
 * This code is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation.
 *
 * This code is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * @author Cay Horstmann
 */

import info.gridworld.actor.ActorWorld;
import info.gridworld.actor.Bug;
import info.gridworld.actor.Rock;
import info.gridworld.grid.BoundedGrid;
import info.gridworld.grid.Grid;
import info.gridworld.grid.Location;

import java.awt.Color;

/**
 * This class runs a world that contains a bug and a rock, added at random
 * locations. Click on empty locations to add additional actors. Click on
 * populated locations to invoke methods on their occupants. <br />
 * To build your own worlds, define your own actors and a runner class. See the
 * BoxBugRunner (in the boxBug folder) for an example. <br />
 * This class is not tested on the AP CS A and AB exams.
 */
public class MyRunner
{
	public static void main(String[] args)
	{
		Grid g = new BoundedGrid(60, 60);
		
		
		ActorWorld world = new ActorWorld();
		
		world.setGrid(g);
		
		world.add(new DeadFlower());
		world.add(new Rock());

		for(int l = 0; l<world.getGrid().getNumCols(); l = l +1)
		{
			for(int w = (l%2 ==0)?0:1; w<world.getGrid().getNumRows(); w = w +2)
			{
				world.add(new Location(l, w), new Rock(Color.BLACK));
			}
		}
		world.add(new Bug());
		world.show();



	}
}
